package cz.matasek.dbLogger.exception;

import cz.matasek.dbLogger.database.DatabaseConnection;

/**
 * Thrown to indicate that JDBC driver class for the database is missing.
 *
 * @author Luboš Matásek
 */
public class JdbcDriverMissingException extends DbLoggerRuntimeException {

    /**
     * Default exception message.
     */
    private static final String EXCEPTION_MESSAGE = "JDBC driver is missing";
    /**
     * Serial version UID.
     */
    private static final long serialVersionUID = 9093471466432871891L;

    /**
     * Creates a new <code>JdbcDriverMissingException</code> with a message
     * containing missing driver name and database platform name.
     *
     * @param database the database, exception was thrown in
     */
    public JdbcDriverMissingException(DatabaseConnection database) {
        super(database.getJdbcDriverName() + ": " +
                database.getPlatformName() + " " +
                JdbcDriverMissingException.EXCEPTION_MESSAGE);
    }
}
